package vboot.core.module.mon.log.error;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

@Entity
@Getter
@Setter
@Table(name = "mon_log_error")
@NoArgsConstructor
public class MonLogError implements Serializable {

    @Id
    private String id;

    /** 操作名称 */
    @Column(length = 32)
    private String name;

    /** 用户ID */
    @Column(length = 32)
    private String useid;

    /** 方法名 */
    private String method;

    /** 参数 */
    @Lob
    private String param;

    /** 日志类型 */
    private String type;

    /** 请求ip */
    private String ip;

    /** 地址 */
    private String addre;

    /** 浏览器  */
    private String agbro;

    /** 操作系统  */
    private String ageos;

    /** 请求耗时 */
    private Long time;

    /** 异常详细  */
    @Lob
    private String error;

    /** 创建日期 */
    @CreationTimestamp
    private Timestamp crtim;

    public MonLogError(String type, Long time) {
        this.type = type;
        this.time = time;
    }
}
